Timetables 您所在的位置:网站首页 airflow example Timetables

Timetables

2023-10-21 15:29| 来源: 网络整理| 查看: 265

The time when a DAG run is triggered¶

There is no difference between the two when catchup is True. Catchup tells you how DAG runs are triggered when catchup is True.

When catchup is False, there is difference in how a new DAG run is triggered. CronTriggerTimetable triggers a new DAG run after the current time, while CronDataIntervalTimetable does before the current time (assuming the value of start_date is past time).

Here is an example showing how the first DAG run is triggered. Supposes there is a cron expression @daily or 0 0 * * *, which is aimed to run at 12AM every day. If you enable DAGs using the two timetables at 3PM on January 31st, CronTriggerTimetable will trigger a new DAG run at 12AM on February 1st. CronDataIntervalTimetable, on the other hand, will immediately trigger a new DAG run which is supposed to trigger at 12AM on January 31st if the DAG had been enabled beforehand.

This is another example showing the difference in the case of skipping DAG runs. Suppose there are two running DAGs using the two timetables with a cron expression @daily or 0 0 * * *. If you pause the DAGs at 3PM on January 31st and re-enable them at 3PM on February 2nd, CronTriggerTimetable skips the DAG runs which are supposed to trigger on February 1st and 2nd. The next DAG run will be triggered at 12AM on February 3rd. CronDataIntervalTimetable, on the other hand, skips the DAG runs which are supposed to trigger on February 1st only. A DAG run for February 2nd is immediately triggered after you re-enable the DAG.

By these examples, you see how CronTriggerTimetable triggers DAG runs is more intuitive and more similar to what people expect cron to behave than how CronDataIntervalTimetable does.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有